---
title: bud.setPublicPath
description: Set the public path
tags:
  - configuration
  - facade
  - filesystem
---

Set the public path. By default the public path will be `''` in production and `/` in development.

To get the value set by this function you should use [publicPath](/reference/bud.publicPath)

## Usage

Set the public path using a string:

```js
bud.setPublicPath('/assets/')
```

Set the public path using a function:

```js
bud.setPublicPath(publicPath => {
  return `https://cdn.com/${publicPath}`
})
```

## CLI

You may set the public path using the CLI using the `--publicPath` flag:

```sh
bud build --publicPath /assets/
```

## Related

- [bud.publicPath](/reference/bud.publicPath)
